package com.qiqitrue.caipiao.lottery;

import com.jfinal.config.Constants;
import com.jfinal.config.Handlers;
import com.jfinal.config.Interceptors;
import com.jfinal.config.JFinalConfig;
import com.jfinal.config.Plugins;
import com.jfinal.config.Routes;
import com.jfinal.core.JFinal;
import com.jfinal.plugin.ehcache.EhCachePlugin;
import com.jfinal.template.Engine;
import com.qiqitrue.caipiao.lottery.controller.LotteryController;

public class MainConfig extends JFinalConfig {

	@Override
	public void configConstant(Constants constants) {
		constants.setDevMode(true);
		
	}

	@Override
	public void configEngine(Engine engine) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void configHandler(Handlers handlers) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void configInterceptor(Interceptors interceptors) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void configPlugin(Plugins plugins) {
		plugins.add(new EhCachePlugin());
		
	}

	@Override
	public void configRoute(Routes routes) {
		routes.setBaseViewPath("/");
		routes.add("/lottery", LotteryController.class);
	}
	
	public static void main(String[] args) {
		// eclipse 下的启动方式
	    JFinal.start("src/main/webapp", 80, "/", 5);
	}

}
